package myJs.admin.sampleIdManage

import myJs.Implicits._
import myJs.cps.Style
import myJs.cps.project.QrcodeCp
import myJs.myPkg._
import myJs.myPkg.jquery.$
import myJs.myPkg.reactBootstrap.{Modal, ModalDialog}
import myJs.myPkg.reactDraggable._
import myJs.tool.Pojo.ImageData
import myJs.tool.Tool
import org.scalajs.macrotaskexecutor.MacrotaskExecutor.Implicits._
import slinky.core.{FunctionalComponent, StatelessComponent}
import slinky.core.annotations.react
import slinky.core.facade.ReactElement
import slinky.web.html._
import typings.csstype.csstypeStrings

import scala.concurrent.Future
import scala.scalajs.js

/**
 * Created by yz on 21/1/2022
 */
@react object DraggableModalDialogCp {

  case class Props(
                    centered: js.UndefOr[Boolean] = js.undefined,
                    contentClassName: js.UndefOr[String] = js.undefined,
                    scrollable: js.UndefOr[Boolean] = js.undefined,
                    size: js.UndefOr[String] = js.undefined,
                    bsPrefix: js.UndefOr[String] = js.undefined,
                    children: js.UndefOr[ReactElement] = js.undefined,
                  )

  val component = FunctionalComponent[Props] { props =>
    Draggable(handle = ".modal-title")(
      ModalDialog(
        centered = props.centered,
        contentClassName = props.contentClassName,
        scrollable = props.scrollable,
        bsPrefix = s"${props.size} modal",
      )(
        props.children
      )
    )
  }

}
